<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI Use Tests</title>
</head>

<body class="yui3-skin-sam">

<h1>Namespace Tests</h1>
<p><input type="button" value="Run Tests" id="btnRun" disabled="true" /></p>

<script type="text/javascript" src="../../../../build/yui/yui-debug.js"></script>
<script type="text/javascript" src="../../../../build/oop/oop.js"></script>
<script type="text/javascript" src="../../../../build/event-custom/event-custom.js"></script>
<script type="text/javascript" src="../../../../build/dom/dom.js"></script>
<script type="text/javascript" src="../../../../build/event/event.js"></script>
<script type="text/javascript" src="../../../../build/node/node.js"></script>
<script type="text/javascript" src="../../../../build/json/json.js"></script>
<script type="text/javascript" src="../../../../build/pluginhost/pluginhost.js"></script>
<script type="text/javascript" src="../../../../build/substitute/substitute.js"></script>
<script type="text/javascript" src="../../../../build/event-simulate/event-simulate.js"></script>
<script type="text/javascript" src="../../../../build/test/test.js"></script>
<script type="text/javascript">

(function() {
    YUI({
        logExclude: {Dom: true, Selector: true, Node: true, attribute: true, base: true, event: true, widget: true}
    }).use("test", function(Y) {

        var count = 0, testUse;

        YUI().use("*", function(Y2) {

            Y.log('Use * entry');
            count++;

            testUse = new Y2.Test.Case({
                    name: "Usestar tests",

                test_use_star: function () {

                    // Loader should not have been pulled in if dependencies are right
                    Y2.Assert.isUndefined(Y2.Loader);
                }

            });

        });

        YUI({
            bootstrap: false
        }).use("test", "blahblah", function(Y3) {

            // Y.log('Use missing');
            count++;

            testUse = new Y.Test.Case({
                    name: "Usestar tests",

                test_missing_message: function () {

                }

            });

        });

        Y.Test.Runner.add(testUse);
        Y.Test.Runner.run();

        testRan = new Y.Test.Case({
                name: "ran tests",

            test_ran: function () {
                // tests to make sure the use('*') callback executed
                Y.Assert.areEqual(2, count);
            }

        });

        Y.Test.Runner.add(testRan);
        Y.Test.Runner.run();
    });
})();
</script>
</body>
</html>
